<%@ Page Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" CodeFile="Checkout.aspx.cs" Inherits="Checkout" Title="Checkout" %>
<%@ Register Src="Modules/Checkout/PaymentBox.ascx" TagName="PaymentBox" TagPrefix="uc6" %>
<%@ Register Src="Modules/AddressEntry.ascx" TagName="AddressEntry" TagPrefix="uc2" %>
<%@ Register Src="Modules/ResultMessage.ascx" TagName="ResultMessage" TagPrefix="uc5" %>
<%@ Register Src="Modules/Content/Paragraph.ascx" TagName="Paragraph" TagPrefix="uc5" %>
<%@ Register Src="Modules/AdContainer.ascx" TagName="AdContainer" TagPrefix="uc4" %>
<%@ Register Src="Modules/CatalogList.ascx" TagName="CatalogList" TagPrefix="uc3" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <atlas:ScriptManager runat="server" EnablePartialRendering="true" EnableScriptComponents="true"
        ID="scriptManager">
    </atlas:ScriptManager>
    <div id="leftcontent">
        <div>
            <uc5:Paragraph ID="paraLeft" runat="server" ContentName="CheckoutTopLeft" />
        </div>
    </div>
    <div id="centercontent">
        <atlas:UpdatePanel ID="WizUpdatePanel" runat="server" Mode="Conditional">
            <ContentTemplate>
                <asp:Panel ID="pnlExpressCheckout" runat="server">
                    <div class="sectionheader">
                        Shortcut for PayPal Users</div>
                    <div class="tenpixspacer">
                    </div>
                    <table width="500">
                        <tr>
                            <td width="200">
                                <asp:ImageButton ID="imgPayPal" runat="server" ImageUrl="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif"
                                    OnClick="imgPayPal_Click" CausesValidation="False" /></td>
                            <td class="smalltext">
                                Save Time. Checkout Securely. Pay without sharing your financial information.</td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <br />
                                <asp:Label ID="lblPPErr" runat="server" ForeColor="Maroon"></asp:Label></td>
                        </tr>
                    </table>
                    <div class="twentypixspacer">
                </asp:Panel>
                <asp:Panel ID="pnlPPStandard" runat="server">
                    <table width="500">
                        <tr>
                            <td width="200">
                                <a href="checkoutppstandard.aspx">
                                    <img src="images/paypal_logo.gif" /></a></td>
                            <td class="smalltext">
                                Checkout securely at PayPal. Our site will be notified when payment is received
                                and we will process your order right away.</td>
                        </tr>
                    </table>
                    </div>
                    <div class="twentypixspacer">
                </asp:Panel>
                <br />
                <asp:Wizard ID="wizCheckout" runat="server" ActiveStepIndex="0" CancelDestinationPageUrl="basket.aspx"
                    DisplayCancelButton="false" DisplaySideBar="false" Width="650" OnActiveStepChanged="Step_Changed">
                    <WizardSteps>
                        <asp:WizardStep runat="server" Title="Enter Shipping Info">
                            <table cellpadding="4">
                                <tr>
                                    <td>
                                        <img src="images/ship_selected.gif" /></td>
                                    <td>
                                        <img src="images/bill_notselected.gif" /></td>
                                    <td>
                                        <img src="images/confirm_notselected.gif" /></td>
                                </tr>
                            </table>
                            <br />
                            <uc2:AddressEntry ID="addShipping" runat="server" UseAddressBook="true" />
                        </asp:WizardStep>
                        <asp:WizardStep runat="server" Title="Billing">
                            <table cellpadding="4">
                                <tr>
                                    <td>
                                        <asp:ImageButton ID="imgShip" runat="server" ImageUrl="~/images/ship_notselected.gif"
                                            OnClick="imgShip_Click" /></td>
                                    <td>
                                        <img src="images/bill_selected.gif" /></td>
                                    <td>
                                        <img src="images/confirm_notselected.gif" /></td>
                                </tr>
                            </table>
                            <br />
                            <uc6:PaymentBox ID="PaymentBox1" runat="server"></uc6:PaymentBox>
                            <br />
                            <div class="sectionheader">
                                Billing Address</div>
                            <uc2:AddressEntry ID="addBilling" runat="server" UseAddressBook="true" />
                        </asp:WizardStep>
                        <asp:WizardStep ID="wizConfirm" runat="server" Title="Confirm And Submit Your Order">
                            <asp:Panel ID="pnlFinalHeadNav" runat="server">
                                <table cellpadding="4">
                                    <tr>
                                        <td>
                                            <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/ship_notselected.gif"
                                                OnClick="ImageButton1_Click" /></td>
                                        <td>
                                            <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/bill_notselected.gif"
                                                OnClick="ImageButton2_Click" /></td>
                                        <td>
                                            <img src="images/confirm_selected.gif" /></td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="pnlReceipt" runat="server" Visible="false">
                                <table width="650">
                                    <tr>
                                        <td>
                                            <h4>
                                                Order
                                                <%=currentOrder.OrderNumber %>
                                                Is Complete!</h4>
                                            <br />
                                            Transaction Code: <b>
                                                <%=currentOrder.Transactions[0].AuthorizationCode %>
                                            </b>
                                            <br />
                                            Status: <b>
                                                <%=Utility.ParseCamelToProper(Enum.GetName(typeof(Commerce.Common.OrderStatus), currentOrder.OrderStatus)) %>
                                            </b>
                                            <br />
                                            <br />
                                            Please keep this number handy as we'll ask you for it should you need to return
                                            your items.
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <br />
                            <table width="100%">
                                <tr>
                                    <td>
                                        <div class="sectionheader">
                                            Ship To:</div>
                                        <asp:Label ID="lblShipTo" runat="server"></asp:Label>
                                    </td>
                                    <td>
                                        <div class="sectionheader">
                                            Bill To:</div>
                                        <asp:Label ID="lblBillTo" runat="server"></asp:Label>
                                    </td>
                                </tr>
                            </table>
                            <div class="twentypixspacer">
                            </div>
                            <div class="sectionheader">
                                Payment Summary</div>
                            <asp:Label ID="lblPaySummary" runat="server"></asp:Label>
                            <div class="twentypixspacer">
                            </div>
                            <div class="sectionheader">
                                Shipping Options</div>
                            <asp:RadioButtonList ID="radShipChoices" runat="server" AutoPostBack="True" OnSelectedIndexChanged="radShipChoices_SelectedIndexChanged"
                                BorderStyle="None">
                            </asp:RadioButtonList>
                            <div class="twentypixspacer">
                            </div>
                            <asp:Panel ID="pnlCoupons" runat="server">
                                <div class="sectionheader">
                                    Coupons</div>
                                Enter Coupon Code:<asp:TextBox ID="couponCode" runat="server" EnableViewState="False"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="couponCode"
                                    ErrorMessage="Please enter a coupon code." ValidationGroup="coupon">*</asp:RequiredFieldValidator>
                                <asp:Button ID="applyCoupon" runat="server" Text="Apply" OnClick="applyCoupon_Click"
                                    ValidationGroup="coupon" />
                                <br />
                                <asp:Label ID="couponMessage" runat="server" EnableViewState="False" Font-Bold="True"
                                    Text="Label" Visible="False"></asp:Label>
                            </asp:Panel>
                            <div class="twentypixspacer">
                            </div>
                            <div class="sectionheader">
                                Order Items:</div>
                            <asp:Label ID="lblOrderItems" runat="server"></asp:Label>
                        </asp:WizardStep>
                    </WizardSteps>
                    <FinishNavigationTemplate>
                    </FinishNavigationTemplate>
                    <StartNavigationTemplate>
                    </StartNavigationTemplate>
                    <StepNavigationTemplate>
                    </StepNavigationTemplate>
                </asp:Wizard>
                <asp:Panel ID="pnlNav" runat="server">
                    <br />
                    <table width="400">
                        <tr>
                            <td align="right">
                                <asp:Button ID="btnPrev" runat="server" Visible="false" OnClick="btnPrev_Click" />
                                <asp:Button ID="btnNext" runat="server" Text="Billing >>" OnClick="btnNext_Click" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
                <asp:Panel ID="pnlComplete" runat="server" Visible="false">
                    <table width="650">
                        <tr>
                            <td style="height: 60px;">
                                <uc5:ResultMessage ID="ResultMessage1" runat="server" />
                            </td>
                            <td align="right">
                                <asp:Button ID="btnComplete" runat="server" Text="Place Your Order" OnClick="btnComplete_Click"
                                    CausesValidation="false" />
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </ContentTemplate>
        </atlas:UpdatePanel>
        <atlas:UpdateProgress ID="uProgress" runat="server">
            <ProgressTemplate>
                <div class="loadingbox">
                    <img src="images/spinner.gif" align="absmiddle" />&nbsp;&nbsp;<asp:Label ID="lblProgress"
                        runat="server">Processing...</asp:Label>
                </div>
            </ProgressTemplate>
        </atlas:UpdateProgress>
    </div>

</asp:Content>
